package com.zznode.redsun.commons.dto;

import java.util.Date;

import com.zznode.csp.domain.basemodel.DomainBusiness;
import com.zznode.redsun.commons.utils.GlobalUtils;

public class BaseDto {
	protected Long id;

	protected String code;

	protected String name;

	protected String description;

	protected Boolean isDeleted = Boolean.FALSE;

	protected Date createDate;

	protected String createDateString;

	protected void setParentField(DomainBusiness entity) {
		if (null == entity) {
			return;
		}
		this.id = entity.getId();
		this.code = entity.getCode();
		this.name = entity.getName();
		this.description = entity.getDescription();
		this.createDate = entity.getCreateDate();
		this.createDateString = GlobalUtils.formartDateTime(this.createDate);
		this.isDeleted = entity.getIsDeleted();
	}

	public void update(DomainBusiness entity) {
		entity.setCode(code);
		entity.setName(name);
		// entity.setCreateDate(createDate);
		entity.setDescription(description);
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public Boolean getIsDeleted() {
		return isDeleted;
	}

	public void setIsDeleted(Boolean isDeleted) {
		this.isDeleted = isDeleted;
	}

	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	public String getCreateDateString() {
		return createDateString;
	}

	public void setCreateDateString(String createDateString) {
		this.createDateString = createDateString;
	}

}
